﻿using System;
using System.Diagnostics;

namespace Project1_SumNaturalNumbersBelow1000 {
    class Program {
        static void Main(string[] args) {

            Console.WriteLine("Project Euler Problem 1: Add all the natural numbers below one thousand that are multiples of 3 or 5");
            Stopwatch timer = new Stopwatch();
            timer.Start();

            int sum = 0;

            for (int count = 0; count < 1000; count++) {
                if (count % 5 == 0
                    || count % 3 == 0) {
                    sum += count;
                }
            }

            timer.Stop();
            Console.WriteLine("\nAnswer: {0}\nin {1}ms ({2}ns)", sum, timer.ElapsedMilliseconds, timer.ElapsedTicks);
            Console.WriteLine("\nPress RETURN to exit...");
            Console.ReadLine();
        }
    }
}
